//
//  PFPhotoType.h
//  PrintFamily
//
//  Created by edaihua on 16/2/26.
//  Copyright © 2016年 ___PrintFactory___. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PFCommonRectManager.h"

@class PHAsset;

/* PFPhotoRectManager manages all rect related issue with a single photo. It also stores the photo resize&crop information. */

@interface PFPhotoRectManager : NSObject

@property (nonatomic, weak) PFCommonRectManager *commonRectManager; // Not owner

@property (nonatomic) CGSize       imagePixelSize; // origin pixel size of the photo
@property (nonatomic) BOOL         isShorterThanTarget;

@property (nonatomic) CGRect       cropPixelRect;

// For photoResizerView recovery
@property (nonatomic) CGFloat      zoomScale;
@property (nonatomic) CGPoint      contentOffset;
@property (nonatomic) CGPoint      contentZoomOffset;

- (PFPhotoRectManager*)initWithType:(PhotoPrintType)type boarder:(PhotoBoarder)boarder asset:(PHAsset*)asset commonManager:(PFCommonRectManager*)manager;
- (void)initCropRect;

- (CGRect)getCropRect;

- (CGSize)getPhotoSize;

// Photo is embeded in the view of PhotoFrame.
- (CGFloat)getPhotoOriginX;
- (CGFloat)getPhotoOriginY;

//- (CGRect)getImageRect;
- (CGRect)getImageRectWithoutScale;

- (void)updatePixelSize:(CGSize)pixelSize;

- (BOOL)isShorterThanTargetHeight;

@end
